﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Frame.Lib.Data;


namespace Forum.Entity.Post
{
    public partial class ForumPostInfo : EntityBase
    {
        public override string GetTableName()
        {
            return "ForumPost";
        }
        public override string GetInsertSql()
        {
            return "insert into ForumPost ( [ID], [Name], [BoardID], [TopicID], [InputTime], [ModifyTime], [MemberID], [MemberName], [State], [IsTop]) values ( @ID, @Name, @BoardID, @TopicID, @InputTime, @ModifyTime, @MemberID, @MemberName, @State, @IsTop)";
        }
        public override string GetUpdateSql()
        {
            return "update ForumPost set  [ID] = @ID, [Name] = @Name, [BoardID] = @BoardID, [TopicID] = @TopicID, [InputTime] = @InputTime, [ModifyTime] = @ModifyTime, [MemberID] = @MemberID, [MemberName] = @MemberName, [State] = @State, [IsTop] = @IsTop where ID = @ID";
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 ID
        {
            get;
            set;
        }
        /// <summary>
        /// 帖子内容
        /// </summary>
        public String Name
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 BoardID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 TopicID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime InputTime
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public DateTime ModifyTime
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public Int32 MemberID
        {
            get;
            set;
        }
        /// <summary>
        /// 
        /// </summary>
        public String MemberName
        {
            get;
            set;
        }
        /// <summary>
        /// 帖子状态
        /// </summary>
        public Int32 State
        {
            get;
            set;
        }
        /// <summary>
        /// 是否是第一个
        /// </summary>
        public Boolean IsTop
        {
            get;
            set;
        }
        public override void SetValue(string key, object value)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    this.ID = (Int32)value;
                    break;
                case "name":
                    this.Name = (String)value;
                    break;
                case "boardid":
                    this.BoardID = (Int32)value;
                    break;
                case "topicid":
                    this.TopicID = (Int32)value;
                    break;
                case "inputtime":
                    this.InputTime = (DateTime)value;
                    break;
                case "modifytime":
                    this.ModifyTime = (DateTime)value;
                    break;
                case "memberid":
                    this.MemberID = (Int32)value;
                    break;
                case "membername":
                    this.MemberName = (String)value;
                    break;
                case "state":
                    this.State = (Int32)value;
                    break;
                case "istop":
                    this.IsTop = (Boolean)value;
                    break;
            }
        }
        public override object GetValue(string key)
        {
            key = key.ToLower();
            switch (key)
            {
                case "id":
                    return this.ID;
                case "name":
                    return this.Name;
                case "boardid":
                    return this.BoardID;
                case "topicid":
                    return this.TopicID;
                case "inputtime":
                    return this.InputTime;
                case "modifytime":
                    return this.ModifyTime;
                case "memberid":
                    return this.MemberID;
                case "membername":
                    return this.MemberName;
                case "state":
                    return this.State;
                case "istop":
                    return this.IsTop;
                default:
                    return null;
            }
        }
    }


}
